-
Notifications
You must be signed in to change notification settings - Fork 8.2k
tests: watchdog: retain memory for frdm_mcxw23 and mcxw23_evk #98625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
tests: watchdog: retain memory for frdm_mcxw23 and mcxw23_evk #98625
Conversation
|
ci failure is reported #97023 |
twister regression test pass on v4.3.0-rc1-142-gae1af302830f |
|
@AllenZhang-NXP is this because the first 8K does not get retained over resets? We have been aware of multiple platforms where this lack of retention impacts this test case. |
Hi @dleach02 , not all of the first 8KB of RAM will be cleared to 0, but at least the RAM from 0x20005000 ~ 0x20005BC0 which is used to store the noinit variables will be cleared, so I reserved the entire first 8KB. |
Boot ROM typically claims the first portion of RAM as its workspace during startup. So even if you store data in the first KB for retention, Boot ROM will overwrite/clear it on next power cycle. Ask ROM team for concrete addresses/sizes. |
Hi @butok, I asked ROM team (Karl Verheyden) and got the reply: For this watchdog test case, I think we only need to skip the first 16KB, because this is used as the data segment in ROM code and might be cleared to zero. The latter 16KB is used as stack and uninitialized buffers, which has no impact on the watchdog test case. Do you agree ? |
So I would reserve/skip 32KB. |
6a14bc3 to
1f6a150
Compare
|
Updated the overlay file to bypass first 32KB SRAM which is used by BOOTROM. |
The first 32KB will be used by BOOT ROM. Added board shared sram bypass first 32KB overlay. The overlay configure shall bypass first 32KB memory to avoid being clear during system startup. Signed-off-by: Allen Zhang <[email protected]>
1f6a150 to
7c02bf4
Compare
|
@AllenZhang-NXP I rebased your PR to main. Lets see if it clears the CI failure. |
|



Added board shared sram bypass first 8KB overlay.
The overlay configure shall bypass first 8KB memory to avoid being clear during system startup.
In test_wdt.c, there're three variables m_state, m_testcase_index and m_testvalue which are linked in the NOINIT_SECTION section.
And these three variables are used to store the test state and the test case index, after the watchdog reset, this case will check the value of the m_state and m_testcase_index, then add 1 to m_testcase_index and run the next test case.
I checked the memory map and found these three variables are linked to:
0x200055e8 m_testvalue
0x200055ec m_testcase_index
0x200055f0 m_state
After the watchdog trigger a reset, the memory starts from 0x20005000 ~ 0x20005BC0 will be set to 0 automatically (Confirmed it is a silicon behaviour, maybe ROM code do this).
As a result, the value of the variables will be cleared to 0. This is why this case is always reset.
Validated the commands below, hi @hakehuang, please help to double check, thank you!
west build -p=auto tests/drivers/watchdog/wdt_basic_api -b frdm_mcxw23 -T drivers.watchdog.nxp_mcxw2xx_bypass_first_8k
west build -p=auto tests/drivers/watchdog/wdt_basic_api -b mcxw23_evk -T drivers.watchdog.nxp_mcxw2xx_bypass_first_8k
Fixes #98282